﻿using Microsoft.AspNetCore.Mvc.Filters;

namespace Server.API
{
    public class EveryExceptionFilters:IExceptionFilter
    {
        private readonly ILogger<EveryExceptionFilters> log;

        public EveryExceptionFilters( ILogger<EveryExceptionFilters> log)
        {
            this.log = log;
        }

        public void OnException(ExceptionContext context)
        {
             log.LogError($"发生异常{context.Exception.Message}");
            //  context.ExceptionHandled = true;
             
        }
    }
}
